package cn.com.chec.en.controller;

import cn.com.chec.en.util.PageBean;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException;

public class BaseMultiActionController extends MultiActionController {
	protected Map<String, Object> map;
	protected String viewName;
	protected static final String ERRORVIEW = "error";
	protected PageBean pageBean;

	public BaseMultiActionController() {
		if (this.map == null)
			this.map = new HashMap<String, Object>();
	}

	protected ModelAndView handleNoSuchRequestHandlingMethod(
			NoSuchRequestHandlingMethodException ex,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		this.map.put("message", "请求不存在!");
		return new ModelAndView("error", this.map);
	}

	public String getViewName() {
		return this.viewName;
	}

	public void setViewName(String viewName) {
		this.viewName = viewName;
	}

	public PageBean getPageBean() {
		return this.pageBean;
	}

	public void setPageBean(PageBean pageBean) {
		this.pageBean = pageBean;
	}
}